<?php

namespace App\Models\Mbr;

use Tymon\JWTAuth\Contracts\JWTSubject;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Laracasts\Presenter\PresentableTrait;

class Member extends Authenticatable implements JWTSubject
{
	use PresentableTrait, Notifiable;
	
	protected $table = 'mbr_members';

	protected $presenter = 'App\Http\Presenters\Mbr\MemberPresenter';

	protected $hidden = ['passwd', 'remember_token'];

	protected $guarded = array();


    public function account()
    {
        return $this->hasOne('\App\Models\Mbr\Account');
    }

	/**
	 * 重写默认密码字段
	 * @return [type] [description]
	 */
	public function getAuthPassword()
	{
      return $this->passwd;
 	}
	

	/**
     * Get the identifier that will be stored in the subject claim of the JWT.
     *
     * @return mixed
     */
    public function getJWTIdentifier() 
    {
        return $this->getKey();
    }

    /**
     * Return a key value array, containing any custom claims to be added to the JWT.
     *
     * @return array
     */
    public function getJWTCustomClaims() 
    {
        return [];
    }

}